//
//  SecondViewController.m
//  GameBoard
//
//  Created by knight on 14-7-14.
//  Copyright (c) 2014年 knight. All rights reserved.
//

#import "EventsViewController.h"
#import "EventsInfoViewController.h"


@interface EventsViewController ()

@end

@implementation EventsViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //初始化数据
    dict1 = [NSDictionary dictionaryWithObjectsAndKeys:@"archery",@"imageName",
            @"射击运动",@"lblTitle",
            @"Held at Lord’s Cricket Ground, the Archery competition at the London 2012 Olympic Games will call for pinpoint precision and nerves of steel.",@"textDesc",
            @"基本",@"info1Title",
            @"标题2",@"info2Title",
            @"Olympic archery, past and present",@"info3Title",
            @"Venue: Lord's Cricket Ground\n\nDates: Friday 27 July – Friday 3 August\n\nMedal events: 4\n\nAthletes: 128 (64 men, 64 women)\n\nArchery dates back around 10,000 years, when bows and arrows were first used for hunting and warfare, before it developed as a competitive activity in medieval England. A tense and testing sport that requires immense reserves of skill and nerve, Archery is now practised in more than 140 countries around the world.",@"textInfo1",
            @"The object of the sport is simple: to shoot arrows as close to the centre of a target as possible. Olympic Archery targets are 122 centimetres in diameter, with the gold ring at the centre (worth a maximum 10 points) measuring just 12.2cm. Archers shoot at the target from a distance of 70 metres. At the Olympic Games, the two individual Archery competitions (one for men, one for women) will be played in a knockout format. Matches will be played over the best of five sets, with each set consisting of three arrows per archer. The winners of each match will qualify for the next round, until the last two archers go head to head in the gold medal match. A knockout format will also be used for the men’s and women’s team competitions, which features teams of three archers competing against each other in a best-of-24-arrows format.",@"textInfo2",
            @"Archery made its Olympic debut at Paris 1900, was dropped from the programme after the 1908 Games, and then returned for a single appearance in 1920. After a 52-year gap, the sport was reintroduced at Munich 1972 and has remained on the Olympic programme ever since. For London 2012, the Archery competition will connect the old with the new at Lord’s Cricket Ground. During the knockout phase, archers will shoot from in front of the 19th-century Pavilion across the hallowed cricket square towards the modern Media Centre.",@"textInfo3",
            nil];
    dict2 = [NSDictionary dictionaryWithObjectsAndKeys:@"athletics",@"imageName",
             @"Athletics",@"lblTitle",
             @"One of the most popular sports that will feature at the London 2012 Olympic Games is also the biggest: Athletics features 2,000 athletes running, walking, jumping and throwing for gold.",@"textDesc",
             @"Base",@"info1Title",
             @"Key Fact",@"info2Title",
             @"Olympic Athletics, past and present",@"info3Title",
             @"Venue: Olympic Stadium – Olympic Park (track, field and combined events); The Mall (road events)\n\nDates: Friday 3 August – Sunday 12 August\n\nMedal events: 47\n\nAthletes: 2,000\n\nAthletics is the perfect expression of the Olympic motto ‘Citius, Altius, Fortius’ (‘Faster, Higher, Stronger’) – the competition requires athletes to run faster, throw further, jump higher and leap longer than their rivals. With 2,000 athletes competing in 47 events, Athletics is the largest single sport at the Games.",@"textInfo1",
             @"The ancient Olympic Games featured the ‘stadium’ race, a sprint of roughly 192 metres. Winners in this event have been recorded as far back as 776 BC. The first modern Olympic Games in 1896 included a Marathon, which was designed specifically to pay homage to Ancient Greece.\n\nIn 1908, the race’s distance was extended from around 25 miles to 26.2 miles (42.195 kilometres) so that it finished in front of the Royal Box. This distance became standard for the Marathon and is still used today.\n\nFor London 2012, all non-road Athletics events will be held at the Olympic Stadium in the new Olympic Park. This state-of-the-art venue, which will have a capacity of 80,000 during the Games, will also host the Opening and Closing Ceremonies.",@"textInfo2",
             @"Venue: Olympic Stadium – Olympic Park (track, field and combined events); The Mall (road events)\n\nDates: Friday 3 August – Sunday 12 August\n\nMedal events: 47\n\nAthletes: 2,000\n\nAthletics is the perfect expression of the Olympic motto ‘Citius, Altius, Fortius’ (‘Faster, Higher, Stronger’) – the competition requires athletes to run faster, throw further, jump higher and leap longer than their rivals. With 2,000 athletes competing in 47 events, Athletics is the largest single sport at the Games.",@"textInfo3",
             nil];
    dict3 = [NSDictionary dictionaryWithObjectsAndKeys:@"badminton",@"imageName",
             @"Badminton",@"lblTitle",
             @"Badminton players at the London 2012 Olympic Games will need lightning-fast reactions if they’re to keep up with shuttlecocks travelling at speeds in excess of 400km/h.",@"textDesc",
             @"Fact",@"info1Title",
             @"Base",@"info2Title",
             @"Olympic Badminton, past and present",@"info3Title",
             @"Venue: Wembley Arena\n\nDates: Saturday 28 July – Sunday 5 August\n\nMedal events: 5\n\nAthletes: 172\n\nDuring the 19th century, British military officers in the Indian town of Poona added a net to the ancient game of battledore (meaning ‘bat’) and shuttlecock, and named this new game after the town.\n\nThe sport of Poona was eventually brought back home by the officers, and was played at the Duke of Beaufort’s Gloucestershire residence in 1873. The residence was (and is still) called Badminton House, which is how this thrilling sport got the name used today.",@"textInfo1",
             @"Badminton is played on a rectangular court split in half by a central net, with singles and doubles events on the Olympic Games programme. Olympic shuttlecocks weigh between 4.74 grams and 5.5g and contain 16 feathers, each plucked from the left wing of a goose. They can travel at speeds in excess of 400km/h.\n\nMatches are played over the best of three games, and each game is won by the first player or doubles pair to reach 21 points by a margin of two clear points. However, if the score reaches 29-29, the winner of the next point wins the game.\n\nAt London 2012, there will be five medal events: men’s and women’s Singles, men’s and women’s Doubles, and Mixed Doubles. All events will begin with a preliminary stage: the competitors will be divided into groups, and each player and doubles pair will play everyone else in their group.\n\nThe best players and doubles pairs from this stage (16 in each Singles event, eight pairs in each Doubles event) will qualify for the knockout stage of the competition, which will eventually decide the winners of the medals.",@"textInfo2",
             @"One of the most dynamic Olympic sports, Badminton made its full Olympic debut at Barcelona 1992. Although the rules of the modern sport were developed in England, Asian countries now dominate: China, Indonesia and South Korea have won 23 of the 24 gold medals awarded since the sport’s first appearance at the Games.\n\nThe London 2012 Badminton competition will be held at Wembley Arena, on a site that has hosted major events ever since the British Empire Exhibition opened there in 1924.",@"textInfo3",
             nil];
    dict4 = [NSDictionary dictionaryWithObjectsAndKeys:@"basketball",@"imageName",
             @"Basketball",@"lblTitle",
             @"At the London 2012 Olympic Games, one of the world’s most popular and fastest-growing team sports will be showcased at the Basketball Arena and North Greenwich Arena.",@"textDesc",
             @"Fact",@"info1Title",
             @"Base",@"info2Title",
             @"Olympic Basketball, past and present",@"info3Title",
             @"Venues: Basketball Arena – Olympic Park (preliminaries, women’s quarter-finals); North Greenwich Arena (men’s quarter-finals and women’s semi-finals onwards)\n\nDates: Saturday 28 July – Sunday 12 August\n\nMedal events: 2\n\nAthletes: 288 (144 men, 144 women, 12 teams in each event).\n\nBasketball was invented in 1891 by Dr James Naismith, a Canadian physical education teacher who wanted to create a game that could be played indoors during the winter by his students at the YMCA in Springfield, Massachusetts.\n\nThe first game, which took place in December 1891, used peach baskets for goals. In the 120 years since these humble beginnings, basketball has grown into one of the most exciting and popular team sports in the world.",@"textInfo1",
             @"Basketball is played by two teams of five players on an indoor court that is 28 metres long and 15m wide. Points are scored by shooting the ball into your opponents’ net (or 'basket'), which has a diameter of 450-459mm and sits on a backboard 3.05m above the floor.Two points are awarded for a regular shot from open play, with one point for each successful free throw (following an opposition infringement) and three points for a shot from distance (beyond what’s known as the three-point line, 6.75m from the basket). Games last for 40 minutes, split into four 10-minute quarters.\n\nAt London 2012, both the men’s and women’s Basketball competitions will begin with a preliminary stage: the 12 teams will be divided into two groups of six, and each team will play every other team in their group. The best eight teams during the preliminaries will qualify for the knockout stage, with the winners of the semi-finals going head-to-head in the gold medal game.",@"textInfo2",
             @"Men’s Basketball first appeared on the Olympic programme at the Berlin 1936 Games, with the women’s event introduced at Montreal 1976. Professional players first competed at the Barcelona 1992, when the famous US ‘Dream Team’ won gold in the men’s event.\n\nAt London 2012, the Basketball competition will take place in two venues. All preliminary games, along with the women’s quarter-finals, will take place at the Basketball Arena, a new, purpose-built venue in the Olympic Park. The men’s quarter-finals, plus all semi-finals and medal games, will be held at the state-of-the-art North Greenwich Arena just across the Thames.",@"textInfo3",
             nil];
    
    
}

- (void) dealloc
{
    NSLog(@"EventsViewController 销毁进行中..");
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}


- (IBAction)clickArchery:(id)sender {
    
    NSInteger clickId = [sender tag];
    NSLog(@"按键的值是： %d",clickId);
    tagInt = clickId;
    [self performSegueWithIdentifier:@"infoList" sender:self];
}

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    /**通过这样的方式只能传NSString 不能传其他类型
     [infoController setValue:@"come on !" forKey:@"info1Title"];
     **/
    
    if ([segue.identifier isEqualToString:@"infoList"]) {
        
        EventsInfoViewController * infoController = [segue destinationViewController];
        
        switch (tagInt) {
            case 101:
                [infoController setValue:dict1 forKey:@"strDinctionary"];
                break;
            case 102:
                [infoController setValue:dict2 forKey:@"strDinctionary"];
                break;
            case 103:
                [infoController setValue:dict3 forKey:@"strDinctionary"];
                break;
            case 104:
                [infoController setValue:dict4 forKey:@"strDinctionary"];
                break;
            default:
                break;
        }
        
        
    }
}


@end
